﻿<%@ Page Language="c#" Inherits="TRPOP.CMS.Web.UI.SwfUpload_Default" AutoEventWireup="true"
    EnableTheming="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="cache-control" content="no-cache" />
    <title>Ckeditor多文件上传插件</title>
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../../../jquery.js"></script>
    <script type="text/javascript" src="../../../../jquery.cookie.js"></script>
    <script type="text/javascript" src="swfupload/swfupload.js"></script>
    <script type="text/javascript" src="js/handlers.js"></script>
    <script type="text/javascript">
        var swfu;
        $(document).ready(function () {
            document.getElementById('thumbnails').innerHTML = '';
            document.getElementById('divFileProgressContainer').innerHTML = '';
            //alert("Default.aspx loaded" + Math.random());
        });
        function ClearAllPic() {
            window.parent.document.getElementById("MultilFileUpLoad_hiddenFiles_values").value = "";
            document.getElementById("thumbnails").innerHTML = "";
            $("#thumbnails").html("");
            return false;
        }
        function ClearOnePic(src, index) {
            if (confirm("确认删除吗？")) {
                window.parent.document.getElementById("MultilFileUpLoad_hiddenFiles_values").value = window.parent.document.getElementById("MultilFileUpLoad_hiddenFiles_values").value.replace(src + "|", "");
                $("#" + index).hide();
            }
        }
        window.onload = function () {
            swfu = new SWFUpload({
                // Backend Settings
                upload_url: 'upload.aspx',

                // File Upload Settings
                file_size_limit: "2 MB",
                file_types: "*.jpg;*.gif;*.png;*.jpeg",
                file_types_description: "图片类型",
                file_upload_limit: 0,    // Zero means unlimited

                // Event Handler Settings - these functions as defined in Handlers.js
                //  The handlers are not part of SWFUpload but are part of my website and control how
                //  my website reacts to the SWFUpload events.
                swfupload_preload_handler: preLoad,
                swfupload_load_failed_handler: loadFailed,
                file_queue_error_handler: fileQueueError,
                file_dialog_complete_handler: fileDialogComplete,
                upload_progress_handler: uploadProgress,
                upload_error_handler: uploadError,
                upload_success_handler: uploadSuccess,
                upload_complete_handler: uploadComplete,

                // Button settings
                button_image_url: "images/XPButtonNoText_160x22.png",
                button_placeholder_id: "spanButtonPlaceholder",
                button_width: 160,
                button_height: 22,
                button_text: '<span class="button">选择本地图片并上传</span>',
                button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }',
                button_text_top_padding: 1,
                button_text_left_padding: 15,

                // Flash Settings
                flash_url: "swfupload/swfupload.swf", // Relative to this file
                flash9_url: "swfupload/swfupload_FP9.swf", // Relative to this file

                custom_settings: {
                    upload_target: "divFileProgressContainer"
                },

                // Debug Settings
                debug: false
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <input type="hidden" value="<%=Session.SessionID %>" id="input_ASPSESSID" />
    <table class="table_search" cellpadding="0" cellspacing="2" width="100%" border="0">
        <tr style="height: 20px;">
            <td valign="middle" nowrap="nowrap" colspan="7">
                <font style="background-color: #FFFFCC; margin-right: 0px;">图片基本设置请通过编辑器上方的设置来完成。</font>
            </td>
        </tr>
        <tr style="height: 20px; display:none;">
            <td valign="middle" nowrap="nowrap" colspan="7">
                图片压缩基本设置: <font style="background-color: #FFFFCC; margin-right: 0px;">等比缩放,即高度将按源图片比例自动生成,宽度为设定的宽度</font>
            </td>
        </tr>
        <tr style="height: 20px; display: none;">
            <td valign="middle" width="20">
            </td>
            <td valign="bottom" nowrap="nowrap" width="120" style="display: inline-block;">
                <input style="margin-top: 5px; display: inline-block; vertical-align: middle;" name="automini"
                    id="automini" type="checkbox" />
                <span style="margin-top: 10px;" title="小贴士: 等比缩放,即按照原图的大小等比压缩为指定的宽度,高度根据原图的大小确定。如果不选择此项，则会将图片强制压缩为设定的宽度和高度，缺少的部分会做留白处理。">
                    是否等比缩放</span>
            </td>
            <td valign="bottom" nowrap="nowrap" width="140" style="display: inline-block;">
                <span style="display: inline-block;">长度:&nbsp;</span>
                <input name="input_width" type="text" id="input_width" style="width: 80px; display: inline-block;
                    vertical-align: middle; margin-top: 5px;" />
            </td>
            <td valign="bottom" nowrap="nowrap" style="display: inline-block;">
                <span style="display: inline-block;">高度:&nbsp;</span>
                <input name="input_height" type="text" id="input_height" style="width: 80px; display: inline-block;
                    vertical-align: middle; margin-top: 5px;" />
            </td>
            <td valign="middle">
                &nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <table class="table_search" cellpadding="0" cellspacing="2" width="100%" border="0">
        <tr valign="middle" style="height: 2px;">
            <td colspan="2">
            </td>
        </tr>
        <tr valign="middle">
            <td>
                &nbsp;&nbsp;<span id="spanButtonPlaceholder"></span> <span style="font-family: Helvetica, Arial, sans-serif;
                    font-size: 14pt;">
                    <input style='background-image: url("images/XPButtonNoText_160x22.png"); font-family: Helvetica, Arial, sans-serif;
                        font-size: 10pt; width: 160px; height: 23px;' name="ClearAllImg" id="ClearAllImg"
                        type="button" value="清空当前页面的图片集" onclick="return ClearAllPic();" />
                </span>
            </td>
            <td>
                &nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <div id="content" style="width: 100%">
        <div id="swfu_container" style="margin: 0px 10px;">
            <div id="divFileProgressContainer" style="height: 75px;">
            </div>
            <div id="thumbnails">
            </div>
        </div>
    </div>
    </form>
</body>
</html>
